//
//  PaperAnalyView.m
//  智云题库
//
//  Created by 毕武侠 on 2017/3/17.
//  Copyright © 2017年 bwx. All rights reserved.
//

#import "PaperAnalyView.h"
#import "PaperAnalyScrollView.h"
#import "PaperAnalyModel.h"

@interface PaperAnalyView ()

@property (nonatomic, strong) PaperAnalyModel *model;
@property (nonatomic, strong) PaperAnalyScrollView *answerView;

@end

@implementation PaperAnalyView
@dynamic answerView;

- (void)setupConfigure {
    [super setupConfigure];
    
    self.answerView = [[PaperAnalyScrollView alloc] initWithFrame:self.frame];
    [self addSubview:self.answerView];
}

- (void)bindModel:(PaperAnalyModel *)model {
    _model = model;
    self.showMaterial = model.showMaterial;
    
    if (model.showMaterial == YES) {
        self.answerView.top = 121+SCREEN_WIDTH / 17;
        self.answerView.height = self.height - 121 - SCREEN_WIDTH / 17;
        [self setupViewFrame:YES];
        self.materialView.textLayout = model.materialLayout;
    } else {
        self.answerView.top = 0;
        self.answerView.height = self.height;
    }
    [self.answerView bindModel:model];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
